package rowingmanager.domain
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author simon
 * Organization can be a rowing club, rowing association, school, college or any other
 * type of institution that can organize rowing regattas
 */
class Organization {

 String title
 String taxid
 String phone
 String type //club,college,school...
 Image avatar
 Set rowers
 Set users
 Address address
 static hasMany = [rowers:Rower,users:User]  //list of users..maybe later change to list of rowers
 static constraints = {
     title(nullable:false,blank:false)
     phone(nullable:false,blank:false)
     type(nullable:false,blank:false)
     avatar(nullable:true)
     rowers(nullable:true)
     users(nullable:true) // allways must have at least one admin user
     address(nullable:false)
     
 }
  //static fetchMode = [user:"eager"]


  public String toString(){
    return title;
  }
}

